
[#include "single/layout/layout02/layout.ftl"/]
[@htmlHead]
<style type="text/css">
    /*.label-line .form-control{display: inline-block;width:20%;}*/
</style>
[/@htmlHead]

[@htmlBody]
<div class="row">
    <div class="col-xs-12">
        <ul class="nav nav-tabs ">
            <li>
                <a href="${base}/languageInfo/view/index">
                    国际化信息管理
                </a>
            </li>
            [#if "add"==operateType]
                <li class="active"><a href="javascript:void(0)">国际化信息增加</a></li>
            [#else ]
                <li class="active"><a href="javascript:void(0)">国际化信息编辑</a></li>
            [/#if]

        </ul>
    </div>
</div>
<div class="row">
    <div class="col-xs-12 ">

        <form class="form-horizontal" action="${base}/languageInfo/view/update" method="post" id="editForm">
            <input type="hidden" name="id" id="id" value="${languageInfo.id}"/>
            <input type="hidden" id="propertyValue" value="${languageInfo.propertyValue}"/>
            <div class="form-group">
                <label class="col-xs-10 col-sm-4 control-label"><span class="required">*</span>国际化键:</label>

                <div class="col-xs-10 col-sm-4  ">
                    <input name="propertyKey" value="${languageInfo.propertyKey}" placeholder="key值"
                           class="form-control " maxlength="64"/>

                </div>
            </div>

            <div id="editAlert" class="" style="min-width:550px"></div>
            <div class="form-group">
                <label class="col-xs-10 col-sm-4 control-label"><span class="required">*</span>国际化值:</label>

                <div class="col-xs-10 col-sm-4  ">
                    <input name="propertyValue"  placeholder="value值"
                           class="form-control " maxlength="64"/>
                </div>
            </div>

            <div class="form-group">
                <label class="col-xs-10 col-sm-4 control-label "><span class="required">*</span>语言类型:</label>

                <div class="col-xs-10 col-sm-4  ">
                    <select name="language" class="form-control ">
                        [#if languages?exists]
                            [#list languages as language]
                                <option value="${language.key}"
                                        [#if languageInfo.language=language.key]selected="selected" [/#if]>${language.value}</option>
                            [/#list]
                        [/#if]
                    </select>

                </div>
            </div>


            <div class="form-group">
                <label class="col-xs-10 col-sm-4 control-label"><span class="required">*</span>标签：</label>

                <div class="col-sm-4 col-xs-6 checkbox-list">

                    [#list labels as label]
                        [#if labelIds??]
                            <label class="checkbox-inline"> <input type="checkbox" name="labels" value="${label.id}" [#list labelIds as labelId][#if labelId.languageLabelId==label.id]checked="checked" [/#if] [/#list]>${label.name}</input></label>
                        [#else ]
                            <label class="checkbox-inline"> <input type="checkbox" name="labels" value="${label.id}">${label.name}</input> </label>
                        [/#if]
                    [/#list]
                </div>
            </div>

            <div class="form-group">
                <label class="col-xs-10 col-sm-4 control-label">描述：</label>

                <div class="col-xs-10 col-sm-4  ">
                    <textarea class="form-control input-large" name="description"
                              style="text-align: left;" maxlength="200">${languageInfo.description}</textarea>
                </div>
            </div>
            <div class="form-group">
                <label class=" col-xs-10 col-sm-4  control-label"></label>

                <div class="col-xs-10 col-sm-4 " align="center">
                    <input type="button" class="btn btn-info btn-sm" value="确定" onclick="doSubmit('${operateType}')"/>
                    <input type="button" onclick="tools.goto('${base}/languageInfo/view/index')"
                           class="btn btn-cancle btn-sm" value="返回"/>
                </div>
            </div>
        </form>

    </div>
</div>
[/@htmlBody]

[@htmlFoot]
    [#include "common/validate.ftl"/]
<script src="${jpath}/assets/public/plugins/dialog/bootbox.js" type="text/javascript"></script>
<script src="${base}/plugins/single/js/module/language/languageInfo.js" type="text/javascript"></script>
<script type="text/javascript">
    $(function () {
       var value=$("#propertyValue").val();
        if(value){
            value =unescape(value.replace(/\\u/g, "%u"));
            $("input[name=propertyValue]").val(value);
        }
    });

</script>
[/@htmlFoot]